Bug 528320 - Incorrect icons displayed for files with custom mimetype
authorAlexander Larsson <alexl@redhat.com>
Thu, 23 Oct 2008 09:59:46 +0000 (09:59 +0000)
committerAlexander Larsson <alexl@src.gnome.org>
Thu, 23 Oct 2008 09:59:46 +0000 (09:59 +0000)
2008-10-23  Alexander Larsson  <alexl@redhat.com>

Bug 528320 - Incorrect icons displayed for files with custom mimetype icons

        * gtk/gtkfilesystem.c:
        (_gtk_file_info_render_icon):
Fall back on default file icon if there was no icon or it
was not found in the theme. This goes with the corresponding
change in glib to not add the fallback icon, but is useful
in other cases too.

svn path=/trunk/; revision=21702

ChangeLog
gtk/gtkfilesystem.c

index f4530b4f69e1b8e35e416c8548ca448f591000cb..e0fcf5d0cd573a7128e0073c53d3915580404d80 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,14 @@
+2008-10-23  Alexander Larsson  <alexl@redhat.com>
+
+       Bug 528320 - Incorrect icons displayed for files with custom mimetype icons
+       
+        * gtk/gtkfilesystem.c:
+        (_gtk_file_info_render_icon):
+       Fall back on default file icon if there was no icon or it
+       was not found in the theme. This goes with the corresponding
+       change in glib to not add the fallback icon, but is useful
+       in other cases too.
+
 2008-10-22  Behdad Esfahbod  <behdad@gnome.org>
 
        Bug 555920 – gtkentry.c passes wrong enum to
index 2b2d44a3bae5ac01a8d2ac0a7e4bc8bea86349f4..3960be29bb242b6e45bb1a674dda0b4dc4e53c5e 100644 (file)
@@ -1738,6 +1738,14 @@ _gtk_file_info_render_icon (GFileInfo *info,
 
       if (icon)
        pixbuf = get_pixbuf_from_gicon (icon, widget, icon_size, NULL);
+
+      if (!pixbuf)
+       {
+          /* Use general fallback for all files without icon */
+         icon = g_themed_icon_new ("text-x-generic");
+         pixbuf = get_pixbuf_from_gicon (icon, widget, icon_size, NULL);
+         g_object_unref (icon);
+       }
     }
 
   return pixbuf;